#!/bin/bash

LOGFILE=create_restore_point.txt
exec 3>&1
exec >> $LOGFILE

echo `date` "	create_restore_point.sh is running"

export ORACLE_SID=CMTEST

./drop_restore_point.sh

sqlplus -s '/ as sysdba' << EOF
create restore point CM_RESTORE_POINT_1 GUARANTEE FLASHBACK DATABASE;
EOF

if [ $? != 0 ]; then
  echo `date` "	Restore point wasn't created"
else
  echo `date` "	Restore point was created successfully"
fi

exec 1>&3  3>&-
